package cn.sccl.dirms.monitor.controller;

import cn.sccl.common.database.DataBase;
import cn.sccl.common.database.DataSet;
import cn.sccl.common.model.PageResult;
import cn.sccl.common.service.BaseManager;
import cn.sccl.common.web.BaseController;
import cn.sccl.dirms.monitor.model.AuditLog;
import cn.sccl.dirms.monitor.service.AuditLogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author _minus
 * @create 2017-04-25 10:22
 */
@RestController
@RequestMapping (value = "/dirms/monitor/auditlog")
public class AuditLogController extends BaseController {

    @Autowired
    DataBase dataBase;

    @Autowired
    AuditLogManager auditLogManager ;
    @RequestMapping ( value = "/all" ,method = RequestMethod.GET)
    public List<AuditLog> getAllAuditLog(){

        return auditLogManager.findAll();
    }

    @RequestMapping ( value = "/pagequery" ,method = {RequestMethod.GET,RequestMethod.POST})
    public PageResult<AuditLog> pageQueryAuditLogs(HttpServletRequest request){

        return auditLogManager.pageQueryAuditLogs(getPageIndex(request),getPageSize(request),getQueryData(request));
    }

}
